{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.chdir('../')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading...\n",
      "Loading customized repurposing dataset...\n",
      "Beginning Downloading Pretrained Model...\n",
      "Note: if you have already download the pretrained model before, please stop the program and set the input parameter 'pretrained_dir' to the path\n",
      "Dataset already downloaded in the local system...\n",
      "Using pretrained model and making predictions...\n",
      "virtual screening...\n",
      "Drug Target Interaction Prediction Mode...\n",
      "in total: 100 drug-target pairs\n",
      "encoding drug...\n",
      "unique drugs: 100\n",
      "encoding protein...\n",
      "unique target sequence: 91\n",
      "Done.\n",
      "predicting...\n",
      "---------------\n",
      "Predictions from model 1 with drug encoding MPNN and target encoding CNN are done...\n",
      "-------------\n",
      "virtual screening...\n",
      "Drug Target Interaction Prediction Mode...\n",
      "in total: 100 drug-target pairs\n",
      "encoding drug...\n",
      "unique drugs: 100\n",
      "encoding protein...\n",
      "unique target sequence: 91\n",
      "Done.\n",
      "predicting...\n",
      "---------------\n",
      "Predictions from model 2 with drug encoding CNN and target encoding CNN are done...\n",
      "-------------\n",
      "virtual screening...\n",
      "Drug Target Interaction Prediction Mode...\n",
      "in total: 100 drug-target pairs\n",
      "encoding drug...\n",
      "unique drugs: 100\n",
      "encoding protein...\n",
      "unique target sequence: 91\n",
      "Done.\n",
      "predicting...\n",
      "---------------\n",
      "Predictions from model 3 with drug encoding Morgan and target encoding CNN are done...\n",
      "-------------\n",
      "virtual screening...\n",
      "Drug Target Interaction Prediction Mode...\n",
      "in total: 100 drug-target pairs\n",
      "encoding drug...\n",
      "unique drugs: 100\n",
      "encoding protein...\n",
      "unique target sequence: 91\n",
      "-- Encoding AAC takes time. Time Reference: 24s for ~100 sequences in a CPU.\t\t\t\t Calculate your time by the unique target sequence #, instead of the entire dataset.\n",
      "Done.\n",
      "predicting...\n",
      "---------------\n",
      "Predictions from model 4 with drug encoding Morgan and target encoding AAC are done...\n",
      "-------------\n",
      "virtual screening...\n",
      "Drug Target Interaction Prediction Mode...\n",
      "in total: 100 drug-target pairs\n",
      "encoding drug...\n",
      "unique drugs: 100\n",
      "encoding protein...\n",
      "unique target sequence: 91\n",
      "-- Encoding AAC takes time. Time Reference: 24s for ~100 sequences in a CPU.\t\t\t\t Calculate your time by the unique target sequence #, instead of the entire dataset.\n",
      "Done.\n",
      "predicting...\n",
      "---------------\n",
      "Predictions from model 5 with drug encoding Daylight and target encoding AAC are done...\n",
      "-------------\n",
      "models prediction finished...\n",
      "aggregating results...\n",
      "virtual screening...\n",
      "Drug Target Interaction Prediction Mode...\n",
      "in total: 100 drug-target pairs\n",
      "encoding drug...\n",
      "unique drugs: 100\n",
      "encoding protein...\n",
      "unique target sequence: 91\n",
      "-- Encoding AAC takes time. Time Reference: 24s for ~100 sequences in a CPU.\t\t\t\t Calculate your time by the unique target sequence #, instead of the entire dataset.\n",
      "Done.\n",
      "predicting...\n",
      "---------------\n",
      "Virtual Screening Result\n",
      "+------+-----------+-------------+---------------+\n",
      "| Rank | Drug Name | Target Name | Binding Score |\n",
      "+------+-----------+-------------+---------------+\n",
      "|  1   |  Drug 80  |  Target 80  |      0.58     |\n",
      "|  2   |  Drug 86  |  Target 86  |      0.85     |\n",
      "|  3   |   Drug 4  |   Target 4  |      0.89     |\n",
      "|  4   |  Drug 89  |  Target 89  |      1.62     |\n",
      "|  5   |  Drug 44  |  Target 44  |      1.67     |\n",
      "|  6   |  Drug 58  |  Target 58  |      1.87     |\n",
      "|  7   |  Drug 35  |  Target 35  |      2.74     |\n",
      "|  8   |  Drug 43  |  Target 43  |      2.98     |\n",
      "|  9   |  Drug 23  |  Target 23  |      3.95     |\n",
      "|  10  |  Drug 25  |  Target 25  |      4.55     |\n",
      "|  11  |  Drug 15  |  Target 15  |      4.86     |\n",
      "|  12  |  Drug 97  |  Target 97  |      5.03     |\n",
      "|  13  |  Drug 24  |  Target 24  |      6.31     |\n",
      "|  14  |  Drug 47  |  Target 47  |      6.53     |\n",
      "|  15  |  Drug 48  |  Target 48  |     11.22     |\n",
      "|  16  |  Drug 50  |  Target 50  |     11.35     |\n",
      "|  17  |  Drug 92  |  Target 92  |     16.71     |\n",
      "|  18  |  Drug 66  |  Target 66  |     17.49     |\n",
      "|  19  |  Drug 26  |  Target 26  |     18.03     |\n",
      "|  20  |  Drug 87  |  Target 87  |     18.64     |\n",
      "|  21  |  Drug 93  |  Target 93  |     19.38     |\n",
      "|  22  |  Drug 20  |  Target 20  |     23.28     |\n",
      "|  23  |  Drug 49  |  Target 49  |     27.10     |\n",
      "|  24  |  Drug 30  |  Target 30  |     28.13     |\n",
      "|  25  |  Drug 33  |  Target 33  |     33.48     |\n",
      "|  26  |  Drug 13  |  Target 13  |     33.54     |\n",
      "|  27  |  Drug 45  |  Target 45  |     34.65     |\n",
      "|  28  |  Drug 29  |  Target 29  |     45.16     |\n",
      "|  29  |  Drug 72  |  Target 72  |     46.54     |\n",
      "|  30  |  Drug 28  |  Target 28  |     55.87     |\n",
      "checkout ./save_folder/results_aggregation/virtual_screening.txt for the whole list\n",
      "\n"
     ]
    }
   ],
   "source": [
    "from DeepPurpose import oneliner\n",
    "from DeepPurpose.dataset import *\n",
    "oneliner.virtual_screening(*load_IC50_1000_Samples())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:DeepPurpose]",
   "language": "python",
   "name": "conda-env-DeepPurpose-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
